package com.googlecode.webduff.exceptions;

import com.googlecode.webduff.WebdavStatus;
import com.googlecode.webduff.methods.MethodResponse;


public class MethodResponseError extends Exception {

	private static final long serialVersionUID = -7348359349495098090L;
	
	private Integer errorCode;
	
	private MethodResponse errorResponse;
	
	public MethodResponseError() {
		this(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
	}
	
	public MethodResponseError(Integer error) {
		errorCode = error;
	}
	
	public MethodResponseError(String message) {
		super(message);
	}
	
	public MethodResponseError(Integer error, String message) {
		this(message);
		errorCode = error;
	}
	
	public MethodResponseError(MethodResponse aResponse) {
		errorCode = aResponse.getStatusCode();
		errorResponse = aResponse;
	}

	public Integer getErrorCode() {
		return errorCode;
	}
	
	public MethodResponse getErrorResponse() {
		return errorResponse;
	}

}